/**
 * 2024
 */
// 此处第二个参数vm，就是我们在页面使用的this，你可以通过vm获取vuex等操作
const install = (Vue, vm) => {

	// 参数配置对象
	const config = vm.vuex_config;

	// 将各个定义的接口名称，统一放进对象挂载到vm.$u.api(因为vm就是this，也即this.$u.api)下
	vm.$u.api = {
		//新增，获取当前用户信息
		userInfo: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute', params),
		//上传头像照片
		uploadHeadPhoto: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute',
			params),
		// 基础服务：登录登出、身份信息、菜单授权、切换系统、字典数据等

		loginRsa: (params = {}) => vm.$u.get(config.adminPath + '/rsaFile/id_key_rsa.pub', params),
		login: (params = {}) => vm.$u.post(config.adminPath + '/accountLogin', params),

		//新闻
		news: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute', params),
		newsView: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute', params),

		logout: (params = {}) => vm.$u.get(config.adminPath + '/mobile/login/logout', params),
		authInfo: (params = {}) => vm.$u.get(config.adminPath + '/authInfo', params),
		menuTree: (params = {}) => vm.$u.get(config.adminPath + '/menuTree', params),
		switchSys: (params = {}) => vm.$u.get(config.adminPath + '/switch/' + params.sysCode),
		dictData: (params = {}) => vm.$u.get(config.adminPath + '/system/dict/data/type/' + params.dictType),

		// 账号服务：验证码接口、忘记密码接口、注册账号接口等
		validCode: (params = {}) => vm.$u.getText('/validCode', params),
		getFpValidCode: (params = {}) => vm.$u.post('/account/getFpValidCode', params),
		savePwdByValidCode: (params = {}) => vm.$u.post('/account/savePwdByValidCode', params),
		getRegValidCode: (params = {}) => vm.$u.post('/account/getRegValidCode', params),
		saveRegByValidCode: (params = {}) => vm.$u.post('/account/saveRegByValidCode', params),

		// APP公共服务
		upgradeCheck: () => vm.$u.post('/app/upgrade/check', {
			appCode: config.appCode,
			appVersion: config.appVersion
		}),
		commentSave: (params = {}) => vm.$u.post('/app/comment/save', params),

		// 个人信息修改
		user: {
			saveUserInfo: (params = {}) => vm.$u.post(config.adminPath + '/mobile/user/saveUserInfo', params),
			infoSavePwd: (params = {}) => vm.$u.put(config.adminPath + '/system/user/profile/updatePwd',
				params),
			infoSavePqa: (params = {}) => vm.$u.post(config.adminPath + '/sys/user/infoSavePqa', params),
		},


		// 组织机构查询
		office: {
			treeData: (params = {}) => vm.$u.get(config.adminPath + '/sys/office/treeData', params),
		},

		// 增删改查例子
		testData: {
			form: (params = {}) => vm.$u.post(config.adminPath + '/test/testData/form', params),
			// list: (params = {}) => vm.$u.post(config.adminPath + '/test/testData/listData', params),
			save: (params = {}) => vm.$u.postJson(config.adminPath + '/test/testData/save', params),
			disable: (params = {}) => vm.$u.post(config.adminPath + '/test/testData/disable', params),
			enable: (params = {}) => vm.$u.post(config.adminPath + '/test/testData/enable', params),
			delete: (params = {}) => vm.$u.post(config.adminPath + '/test/testData/delete', params),
		},

		//search
		search: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute', params),
		searchOne: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute', params),
		searchEq: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute', params),
		searchKey: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute', params),
		//liveVideo
		getVideo: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute',
			params),
		//liveVideoUrl

		getVideoUrl: (params = {}) => vm.$u.postJson('http://192.168.110.146:8888/haikang/getUrlBig',
			params),
		//inflowWater
		inflowWater: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute', params),
		//outWater
		outWater: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute', params),
		//equipmentRunningStateData
		eqStateData: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute', params),
		//water_equipment_inventory_view
		eqView: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute', params),
		//monitor
		monitor: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute', params),
		//searchEquipList
		searchEquipList: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute',
			params),
		//searchEquipList2
		searchEquipList2: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute',
			params),
		//getEqImg
		getEqImg: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute',
			params),

		//getFalarmDetails
		getFalarmDetails: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute',
			params),

		getFile: (params = {}, headers = {}) => vm.$u.postJson(config.adminPath + '/upload/uploadImage/',
			params, headers),

		//searchNotdo
		searchNotdo: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute', params),
		//searchFinished
		searchFinished: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute',
			params),
		//water_maintain_order_view
		orderView: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute', params),
		//getOrderName
		getOrderName: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute', params),
		//water_maintain_order_update:
		orderEdit: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute', params),
		//getFalarmCount	
		getFalarmCount: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute',
			params),
		//getAlarmRealData
		getAlarmRealData: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute',
			params),
		//getWorkOrder
		getWorkOrder: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute', params),

		//日常巡检工单
		findRCXJGDBy: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute',
			params),
		//根据当前用户，获取所属组织机构
		getOrginInfo: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute',
			params),
		//获取下拉厂站列表
		getOrginList: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute',
			params),
		//根据id，获取日常巡检工单详情
		getGDDetail: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute',
			params),
		//查询设备巡检工单
		findSBXJGD: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute',
			params),
		//查询区域巡检工单
		findQYXJGD: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute',
			params),
		//查询区域巡检工单详情
		findQYXJGDDetail: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute',
			params),
		//查询设备巡检工单详情1
		findSBXJGDDetail: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute',
			params),
		//查询设备巡检工单详情2
		findSBXJGDDetail1: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute',
			params),
		//编辑日常巡检工单
		editRCXJGDDetail1: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute',
			params),
		//编辑设备巡检工单
		editSBXJGDDetail1: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute',
			params),
		//编辑区域巡检工单
		editQYXJGDDetail1: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute',
			params),
		//报警响应率
		getStationAlarmData: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute',
			params),
		//事件相应率
		getThingsResponse: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute',
			params),
		// getOrderAllMseeage
		getOrderAllMseeage: (params = {}) => vm.$u.postJson(config.adminPath + '/algorithm/process/execute',
			params),

	};

}

export default {
	install
}